Some computer architectures such as the Intel-Architecture-64 (IA-64) strictly enforce aligned memory access, in which the address of a data object must be divisible by the size in bytes of the data object, subject to the further constraint that memory accesses must be performed in units of 1, 2, 4, or 8 bytes. Also, some computer programming languages recognize a compile-time directive to pack data structures. A packed data structure contains members of different sizes stored contiguously in memory, regardless of the word size of the machine. For example, a 16-bit integer followed by a 64-bit integer stored at contiguous, increasing byte addresses in an IA-64 computer is considered a packed data structure because the first member of the data structure, the 16-bit integer, is smaller than the word size (32 bits). Consequently, the 64-bit integer does not coincide with a 64-bit aligned address. The component parts of an unpacked data structure, on the other hand, are aligned with the word boundaries of the computer. An unpacked version of the foregoing example in an IA-64 machine would occupy two 64-bit words because a compiler would assign the 64-bit integer to an 64-bit aligned address. Therefore, 48 bits of the unpacked data structure between the 16-bit integer and the 64-bit integer are unused filler.
Not all compilers support the packing directive. When data stored in packed format must be read by program code compiled using a compiler that does not support packing on a computer that enforces aligned memory access, fatal run-time exceptions may occur. Specifically, a packed data structure may begin at a memory address that does not lend itself to aligned memory access. It is thus apparent that there is a need in the art for a method for transferring data from a packed to an unpacked data structure.